import request from '@/utils/request'

// 查询订单跟踪列表
export function listlead(query) {
  return request({
    url: '/crm/lead/list',
    method: 'get',
    params: query
  })
}

export function getLeadTimeData(id, pageNum, pageSize) {
  return request({
    url: '/crm/lead/LeadTime/' + id + '?pageNum=' + pageNum + '&pageSize=' + pageSize,
    method: 'get'
  })
}

// 查询订单跟踪详细
export function getlead(id) {
  return request({
    url: '/crm/lead/' + id,
    method: 'get'
  })
}

// 新增订单跟踪
export function addlead(data) {
  return request({
    url: '/crm/lead',
    method: 'post',
    data: data
  })
}

// 修改订单跟踪
export function updatelead(data) {
  return request({
    url: '/crm/lead',
    method: 'put',
    data: data
  })
}

// 删除订单跟踪
export function dellead(id) {
  return request({
    url: '/crm/lead/' + id,
    method: 'delete'
  })
}

// 查询跟进记录列表
export function listComment(query) {
  debugger;
  return request({
    url: '/crm/lead/commentList',
    method: 'get',
    params: query
  })
}

// 新增跟进记录
export function addComment(data) {
  return request({
    url: '/crm/lead/commentAdd',
    method: 'post',
    data: data
  })
}

export function PutPrivilegelead(userIds, id) {
  return request({
    url: '/crm/lead/' + userIds + '/' + id,
    method: 'put',
  })
}

